﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Panel.Master" Inherits="System.Web.Mvc.ViewPage<Prodma.DataAccess.Models.ViewModels.UserVm>" %>


<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
<%=System.Configuration.ConfigurationManager.AppSettings["pageTitle"] %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">



<form id="profil" method="post" action="/user/ChangeUserProfile/">
<div class="detailContainer">
    <div class="detailSection-50pc">
        <div class="detailSectionHeader">Giriş Bilgileri</div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Kullanıcı Adı :</div>
            <div class="detailSectionRowText-80pc"><input type="text" id="userName" name="userName" class="detailSectionControl" value='<%=ViewData.Model.UserName %>' readonly="readonly" /></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Parola :</div>
            <div class="detailSectionRowText-80pc"><input type="password" id="password" name="password" maxlength="10" class="detailSectionControl" /></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Tekrar :</div>
            <div class="detailSectionRowText-80pc"><input type="password" id="password2" name="password2" maxlength="10" class="detailSectionControl" /></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc"></div>
            <div class="detailSectionRowText-80pc"><input type="button" id="btnUserNameAndPasswordChanges" name="btnUserNameAndPasswordChanges" onclick="submitForm();" value="Onayla" class="detailSectionControlButton" /></div>
        </div>
    </div>
    <div class="detailSection-50pc">
        <div class="detailSectionHeader">Kişisel Bilgileri</div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Adı :</div>
            <div class="detailSectionRowText-80pc"><input type="text" id="firstName" name="firstName" maxlength="50" class="detailSectionControl" value='<%=ViewData.Model.FirstName %>' /></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Soyadı :</div>
            <div class="detailSectionRowText-80pc"><input type="text" id="lastName" name="lastName" maxlength="50" class="detailSectionControl" value='<%=ViewData.Model.LastName %>' /></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Mail :</div>
            <div class="detailSectionRowText-80pc"><input type="text" id="mail" name="mail" maxlength="50" class="detailSectionControl" value='<%=ViewData.Model.Mail %>' /></div>
        </div>
    </div>
    
    <input type="hidden" id="id" name="id" value='<%=ViewData.Model.ID %>' />
</div>
</form>

<script type="text/javascript">



    function submitForm() {
        if (userValidate() && userDataValidate()) {
            document.forms["profil"].submit();
        }
    }
    function changeUserNameAndPassword() {
        if (userDataValidate()) {
            var id = $('#id').val();
            var userName = $('#userName').val();
            var password = $('#password').val();

            document.location.replace('/user/changeUserNameAndPassword/?id=' + id + '&userName=' + userName + '&password=' + password);
        }
    }    
</script>

</asp:Content>
